<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
jimport( 'joomla.application.component.view' );


class JAJobBoardViewJACustomcss extends JAView
{
    /**
     * Display the view
     */
    function display($tmpl = null)
    {
		$task = JRequest::getVar("task", '');
		switch ($task){
			case 'edit':				
				JAJobBoardViewJACustomcss::displayForm();
				break;			
			default:
				JAJobBoardViewJACustomcss::displayListItems();
		}
		parent::display($tmpl);
  	}
  	
  	
  	/**
  	* Display List of items
  	*/
  	function displayListItems(){  		
  		global $mainframe, $option;
        $option_1 = $option.'.jacustomcss';
		$search	= $mainframe->getUserStateFromRequest( "$option_1.search", 'search', 	'',	'string' );
		$lists['search']	= JString::strtolower($search );
		$lists['search']	= $mainframe->getUserStateFromRequest( "$option_1.search", 'search', 	'',	'string' );
		$lists['option']	= $option;
	
		$files = $folders = $put = array();
		
		$path = JPATH_COMPONENT_SITE.DS.'css';
		$files = JFolder::files($path);			    

		$template = getTemplate();
		
		$this->assignRef ( 'template', $template );
		
        $this->assignRef('lists', $lists);
        $this->assignRef('files', $files);
        
  	}
  	/**
  	* Display edit form
  	*/
  	function displayForm(){  	    
  		global $option;
  		
		$file = JRequest::getVar('file', '');
		$filename = JPATH_COMPONENT_SITE.DS.'css'.DS.$file;
		
  	    $template = getTemplate();
		$override_content = '';
		$is_override = false;
		if(JFile::exists(JPATH_SITE . DS. 'templates'. DS . $template. DS. 'css'. DS. $file )){
			$override_content = JFile::read(JPATH_SITE . DS. 'templates'. DS . $template. DS. 'css'. DS. $file );
			$is_override = true;
		}
		
		$content = JFile::read ( $filename );
		
		$this->assignRef ( 'template', $template );
		$this->assignRef ( 'content', $content );
		$this->assignRef ( 'override_content', $override_content );
		$this->assignRef ( 'is_override', $is_override );
		$this->assignRef ( 'file', $file );
		$this->assignRef ( 'folder', $folder );
		$this->assignRef ( 'option', $option );
		$this->assign ( 'path_override', JPATH_SITE . DS. 'templates'. DS . $template. DS. 'css'. DS. $file);
	}
    function menu()
	{
		
		$view = JRequest::getVar('view', 'jacustomtmpl');
		
        
        ?>
			<div class="t">
				<div class="t">
					<div class="t"></div>
				</div>
			</div>
			<div class="m">
				<ul id="submenu">
					<li>
						<a href="index.php?option=com_jajobboard&view=jacustomtmpl&menuId=<?php echo JRequest::getVar('menuId');?>"class="<?php if($view==null||$view=='jacustomtmpl')echo 'active' ?>">
							<?php echo JText::_( 'Layout template' ); ?>
						</a>
					</li>				
					<li>
						<a href="index.php?option=com_jajobboard&view=jacustomcss&menuId=<?php echo JRequest::getVar('menuId');?>" class="<?php if($view=='jacustomcss')echo 'active' ?>">
							<?php echo JText::_( 'CSS' ); ?>
						</a>
					</li>
				</ul>
				<div class="clr"></div>
			</div>
			<div class="b">
				<div class="b">
					<div class="b"></div>
				</div>
			</div>		
		<?php		
	}	
}
?>